<% layout('/layouts/default.html', {title: '企业管理', libs: ['validate','fileupload']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text(comCompany.isNewRecord ? '新增企业' : '编辑企业')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${comCompany}" action="${ctx}/company/comCompany/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<#form:hidden path="id"/>
				<#form:hidden path="refCode"/>
				<input type="hidden" id="getProvince" value="${comCompany.province}">
				<input type="hidden" id="getCity" value="${comCompany.city}">
				<input type="hidden" id="getCounty" value="${comCompany.county}">
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('企业名称')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="name" maxlength="50" class="form-control required"/>
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('归属机构')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:treeselect id="office" title="${text('机构选择')}"
										path="employee.office.officeCode" labelPath="employee.office.officeName"
										url="${ctx}/sys/office/treeData?ctrlPermi=2" class="required" allowClear="false" canSelectRoot="true" canSelectParent="true" />
							</div>
						</div>
					</div>

				</div>
				<div class="row">

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('实体店名称')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="storeName" maxlength="255" class="form-control required"/>
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('注册地址')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="address" maxlength="255" class="form-control"/>
							</div>
						</div>
					</div>


					<!--<div class="col-xs-6">-->
						<!--<div class="form-group">-->
							<!--<label class="control-label col-sm-4" title="">-->
								<!--<span class="required hide">*</span> ${text('营业执照图')}：<i class="fa icon-question hide"></i></label>-->
							<!--<div class="col-sm-8">-->
								<!--<#form:input path="businessPicture" maxlength="255" class="form-control"/>-->
							<!--</div>-->
						<!--</div>-->
					<!--</div>-->
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('门店电话')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="storePhone" maxlength="255" class="form-control"/>
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('省市区/县')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-2" style="float: left">
								<#form:select id="s_province" path="province"   blankOption="true" class="form-control required" />
							</div>
							<div class="col-sm-2" style="float: left">
								<#form:select id="s_city" path="city"   blankOption="true" class="form-control required" />
							</div>
							<div class="col-sm-2">
								<#form:select id="s_county" path="county"   blankOption="true" class="form-control required"  />
							</div>
						</div>
					</div>

				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('详细地址')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="detailAddress" maxlength="20" class="form-control"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('负责人姓名')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="managerName" maxlength="20" class="form-control"/>
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('负责人电话')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="managerPhone" maxlength="20" class="form-control"/>
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> ${text('餐饮类型')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="type" dictType="store_type" blankOption="true" class="form-control required"  />
							</div>
						</div>
					</div>

				</div>

				<div class="row">

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('经营许可证')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="licenseNum" maxlength="18" class="form-control"/>
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('许可证有效期')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="licenseIndate" readonly="true" maxlength="20" class="form-control Wdate"
										dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
							</div>
						</div>
					</div>

				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> 标签：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="tag" dictType="store_tag" multiple="true" blankOption="true" class="form-control" />
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> 经营范围：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="businessScope" dictType="store_eat_type" multiple="true" blankOption="true" class="form-control" />
							</div>
						</div>
					</div>


				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('company:comCompany:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>
<script type="text/javascript" src="/../fms/js/common/province.js"></script>
<script>

	if ($("#getProvince").val() !="") {
		_selected_area([$("#getProvince").val(),$("#getCity").val(),$("#getCounty").val()]);
	}

</script>